﻿// Parts Copyright 2008 Newgrove Consultants Limited
// Modified By John Diss 
// From original work:
//
// Copyright 2006 - Ricardo Stuven (rstuven@gmail.com)
//
// This file is part of MsSqlSpatial.
// MsSqlSpatial is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
// 
// MsSqlSpatial is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.

// You should have received a copy of the GNU Lesser General Public License
// along with MsSqlSpatial; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 

#if PENDING_FEATURE

using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
using MsSqlSpatial;

public partial class TableValuedFunctions
{
	/// <summary>
	/// PostGIS docs:
	/// 
	/// Dump(geometry)
	/// 
	/// This is a set-returning function (SRF). It returns a set of geometry_dump rows, 
	/// formed by a geometry (geom) and an array of integers (path). 
	/// 
	/// When the input geometry is a simple type (POINT,LINESTRING,POLYGON) a single record
	/// will be returned with an empty path array and the input geometry as geom. 
	/// 
	/// When the input geometry is a collection or multi 
	/// it will return a record for each of the collection components, 
	/// and the path will express the position of the component inside the collection.
	/// 
	/// </summary>
	/// <param name="ewkb"></param>
	/// <returns></returns>
	[SqlFunction(
		 FillRowMethodName = "FillRowDump"
		, TableDefinition = "geometry varbinary(max), path int"
		, DataAccess = DataAccessKind.Read
		, SystemDataAccess = SystemDataAccessKind.Read
	)]
	public static IEnumerable Dump(SqlBytes ewkb)
	{
		// TODO: Implement
		return null;
	}

	public static void FillRowDump(Object obj, out SqlBytes geometry, out SqlInt32 path)
	{
		geometry = SqlBytes.Null;
		path = SqlInt32.Null;
	}

};
#endif